随机出题,计时功能,验证正确性
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace jiajianshengchu
{
public partial class 小学口算 : Form
{
int currentCount_h = 0;
int currentCount_m = 0;
int currentCount_s = 0;
public 小学口算()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
this.timer1.Interval = 980;
textBox61.Enabled = false;
}
bool isClick = false;
double sum1; double sum2; double sum3; double sum4; double sum5; double sum6;
double sum7; double sum8; double sum9; double sum10; double sum11; double sum12;
double sum13; double sum14; double sum15; double sum16; double sum17; double sum18;
double sum19; double sum20; double sum21; double sum22; double sum23; double sum24;
double sum25; double sum26; double sum27; double sum28; double sum29; double sum30;
private void button1_Click(object sender, EventArgs e)
{
if (isClick == true)
{
textBox2.Text = "";
textBox4.Text = "";
textBox6.Text = "";
textBox8.Text = "";
textBox10.Text = "";
textBox12.Text = "";
textBox14.Text = "";
textBox16.Text = "";
textBox18.Text = "";
textBox20.Text = "";
textBox22.Text = "";
textBox24.Text = "";
textBox26.Text = "";
textBox28.Text = "";
textBox30.Text = "";
textBox32.Text = "";
textBox34.Text = "";
textBox36.Text = "";
textBox38.Text = "";
textBox40.Text = "";
textBox42.Text = "";
textBox44.Text = "";
textBox46.Text = "";
textBox48.Text = "";
textBox50.Text = "";
textBox52.Text = "";
textBox54.Text = "";
textBox56.Text = "";
textBox58.Text = "";
textBox60.Text = "";
}
isClick = true;
Random ex = new Random();
double num1 = ex.Next(2, 100);
double num2 = ex.Next(2, 100);
int num3 = ex.Next(1, 5); //加减剩除
double num4 = ex.Next(2, 100);
double num5 = ex.Next(2, 100);
int num6 = ex.Next(1, 5); //加减剩除
double num7 = ex.Next(2, 100);
double num8 = ex.Next(2, 100);
int num9 = ex.Next(1, 5); //加减剩除
double num10 = ex.Next(2, 100);
double num11 = ex.Next(2, 100);
int num12 = ex.Next(1, 5); //加减剩除
double num13 = ex.Next(2, 100);
double num14 = ex.Next(2, 100);
int num15 = ex.Next(1, 5); //加减剩除
double num16 = ex.Next(2, 100);
double num17 = ex.Next(2, 100);
int num18 = ex.Next(1, 5); //加减剩除
double num19 = ex.Next(2, 100);
double num20 = ex.Next(2, 100);
int num21 = ex.Next(1, 5); //加减剩除
double num22 = ex.Next(2, 100);
double num23 = ex.Next(2, 100);
int num24 = ex.Next(1, 5); //加减剩除
double num25 = ex.Next(2, 100);
double num26 = ex.Next(2, 100);
int num27 = ex.Next(1, 5); //加减剩除
double num28 = ex.Next(2, 100);
double num29 = ex.Next(2, 100);
int num30 = ex.Next(1, 5); //加减剩除
double num31 = ex.Next(2, 100);
double num32 = ex.Next(2, 100);
int num33 = ex.Next(1, 5); //加减剩除
double num34 = ex.Next(2, 100);
double num35 = ex.Next(2, 100);
int num36 = ex.Next(1, 5); //加减剩除
double num37 = ex.Next(2, 100);
double num38 = ex.Next(2, 100);
int num39 = ex.Next(1, 5); //加减剩除
double num40 = ex.Next(2, 100);
double num41 = ex.Next(2, 100);
int num42 = ex.Next(1, 5); //加减剩除
double num43 = ex.Next(2, 100);
double num44 = ex.Next(2, 100);
int num45 = ex.Next(1, 5); //加减剩除
double num46 = ex.Next(2, 100);
double num47 = ex.Next(2, 100);
int num48 = ex.Next(1, 5); //加减剩除
double num49 = ex.Next(2, 100);
double num50 = ex.Next(2, 100);
int num51 = ex.Next(1, 5); //加减剩除
double num52= ex.Next(2, 100);
double num53 = ex.Next(2, 100);
int num54 = ex.Next(1, 5); //加减剩除
double num55 = ex.Next(2, 100);
double num56 = ex.Next(2, 100);
int num57 = ex.Next(1, 5); //加减剩除
double num58 = ex.Next(2, 100);
double num59 = ex.Next(2, 100);
int num60 = ex.Next(1, 5); //加减剩除
double num61 = ex.Next(2, 100);
double num62 = ex.Next(2, 100);
int num63 = ex.Next(1, 5); //加减剩除
double num64 = ex.Next(2, 100);
double num65 = ex.Next(2, 100);
int num66 = ex.Next(1, 5); //加减剩除
double num67 = ex.Next(2, 100);
double num68 = ex.Next(2, 100);
int num69 = ex.Next(1, 5); //加减剩除
double num70 = ex.Next(2, 100);
double num71 = ex.Next(2, 100);
int num72 = ex.Next(1, 5); //加减剩除
double num73 = ex.Next(2, 100);
double num74 = ex.Next(2, 100);
int num75 = ex.Next(1, 5); //加减剩除
double num76 = ex.Next(2, 100);
double num77 = ex.Next(2, 100);
int num78 = ex.Next(1, 5); //加减剩除
double num79 = ex.Next(2, 100);
double num80 = ex.Next(2, 100);
int num81 = ex.Next(1, 5); //加减剩除
double num82 = ex.Next(2, 100);
double num83 = ex.Next(2, 100);
int num84 = ex.Next(1, 5); //加减剩除
double num85 = ex.Next(2, 100);
double num86 = ex.Next(2, 100);
int num87 = ex.Next(1, 5); //加减剩除
double num88 = ex.Next(2, 100);
double num89 = ex.Next(2, 100);
int num90 = ex.Next(1, 5); //加减剩除
string ysf1 = "";
string ysf2 = "";
string ysf3 = "";
string ysf4 = "";
string ysf5 = "";
string ysf6 = "";
string ysf7 = "";
string ysf8 = "";
string ysf9 = "";
string ysf10 = "";
string ysf11 = "";
string ysf12 = "";
string ysf13 = "";
string ysf14 = "";
string ysf15 = "";
string ysf16 = "";
string ysf17 = "";
string ysf18 = "";
string ysf19 = "";
string ysf20 = "";
string ysf21 = "";
string ysf22 = "";
string ysf23 = "";
string ysf24 = "";
string ysf25 = "";
string ysf26 = "";
string ysf27 = "";
string ysf28 = "";
string ysf29 = "";
string ysf30 = "";
switch (num3)
{
case 1:
ysf1 = " ";
while (num1 % num2 != 0)
{
num1 = ex.Next(2, 100);
num2 = ex.Next(2, 100);
while (num1 == num2)
{
num1 = ex.Next(2, 100);
num2 = ex.Next(2, 100);
}
}
sum1 = num1 num2;
break;
case 2:
ysf1 = "-";
while (num1 % num2 != 0)
{
num1 = ex.Next(2, 100);
num2 = ex.Next(2, 100);
while (num1 == num2)
{
num1 = ex.Next(2, 100);
num2 = ex.Next(2, 100);
}
}
sum1 = num1 - num2;
break;
case 3:
ysf1 = "X";
while (num1 % num2 != 0)
{
num1 = ex.Next(2, 20);
num2 = ex.Next(2, 10);
while (num1 == num2)
{
num1 = ex.Next(2, 20);
num2 = ex.Next(2, 10);
}
}
sum1 = num1 * num2;
break;
case 4:
ysf1 = "÷";
while (num1 % num2 != 0)
{
num1 = ex.Next(2, 100);
num2 = ex.Next(2, 100);
while (num1 == num2)
{
num1 = ex.Next(2, 100);
num2 = ex.Next(2, 100);
}
}
sum1 = num1 / num2;
break;
}
textBox1.Text = num1.ToString() " " ysf1 " " num2.ToString() " " "=";
switch (num6)
{
case 1:
ysf2 = " ";
while (num4 % num5 != 0)
{
num4 = ex.Next(2, 100);
num5 = ex.Next(2, 100);
while (num4 == num5)
{
num4 = ex.Next(2, 100);
num5 = ex.Next(2, 100);
}
}
sum2 = num4 num5;
break;
case 2:
ysf2 = "-";
while (num4 % num5 != 0)
{
num4 = ex.Next(2, 100);
num5 = ex.Next(2, 100);
while (num4 == num5)
{
num4 = ex.Next(2, 100);
num5 = ex.Next(2, 100);
}
}
sum2 = num4 - num5;
break;
case 3:
ysf2 = "X";
while (num4 % num5 != 0)
{
num4 = ex.Next(2, 20);
num5 = ex.Next(2, 10);
while (num4 == num5)
{
num4 = ex.Next(2, 20);
num5 = ex.Next(2, 10);
}
}
sum2 = num4 * num5;
break;
case 4:
ysf2 = "÷";
while (num4 % num5 != 0)
{
num4 = ex.Next(2, 100);
num5 = ex.Next(2, 100);
while (num4 == num5)
{
num4 = ex.Next(2, 100);
num5 = ex.Next(2, 100);
}
}
sum2 = num4 / num5;
break;
}
textBox3.Text = num4.ToString() " " ysf2 " " num5.ToString() " " "=";
switch (num9)
{
case 1:
ysf3 = " ";
while (num7 % num8 != 0)
{
num7 = ex.Next(2, 100);
num8 = ex.Next(2, 100);
while (num7 == num8)
{
num7 = ex.Next(2, 100);
num8 = ex.Next(2, 100);
}
}
sum3 = num7 num8;
break;
case 2:
ysf3 = "-";
while (num7 % num8 != 0)
{
num7 = ex.Next(2, 100);
num8 = ex.Next(2, 100);
while (num7 == num8)
{
num7 = ex.Next(2, 100);
num8 = ex.Next(2, 100);
}
}
sum3 = num7 - num8;
break;
case 3:
ysf3 = "X";
while (num7 % num8 != 0)
{
num7 = ex.Next(2, 20);
num8 = ex.Next(2, 10);
while (num7 == num8)
{
num7 = ex.Next(2, 100);
num8 = ex.Next(2, 100);
}
}
sum3 = num7 * num8;
break;
case 4:
ysf3 = "÷";
while (num7 % num8 != 0)
{
num7 = ex.Next(2, 100);
num8 = ex.Next(2, 100);
while (num7 == num8)
{
num7 = ex.Next(2, 100);
num8 = ex.Next(2, 100);
}
}
sum3 = num7 / num8;
break;
}
textBox5.Text = num7.ToString() " " ysf3 " " num8.ToString() " " "=";
switch (num12)
{
case 1:
ysf4 = " ";
while (num10 % num11 != 0)
{
num10 = ex.Next(2, 100);
num11 = ex.Next(2, 100);
while (num10 == num11)
{
num10 = ex.Next(2, 100);
num11 = ex.Next(2, 100);
}
}
sum4 = num10 num11;
break;
case 2:
ysf4 = "-";
while (num10 % num11 != 0)
{
num10 = ex.Next(2, 100);
num11 = ex.Next(2, 100);
while (num10 == num11)
{
num10 = ex.Next(2, 100);
num11 = ex.Next(2, 100);
}
}
sum4 = num10 - num11;
break;
case 3:
ysf4 = "X";
while (num10 % num11 != 0)
{
num10 = ex.Next(2, 20);
num11 = ex.Next(2, 10);
while (num10 == num11)
{
num10 = ex.Next(2, 20);
num11 = ex.Next(2, 10);
}
}
sum4 = num10 * num11;
break;
case 4:
ysf4 = "÷";
while (num10 % num11 != 0)
{
num10 = ex.Next(2, 100);
num11 = ex.Next(2, 100);
while (num10 == num11)
{
num10 = ex.Next(2, 100);
num11 = ex.Next(2, 100);
}
}
sum4 = num10 / num11;
break;
}
textBox7.Text = num10.ToString() " " ysf4 " " num11.ToString() " " "=";
switch (num15)
{
case 1:
ysf5 = " ";
while (num13 % num14 != 0)
{
num13 = ex.Next(2, 100);
num14 = ex.Next(2, 100);
while (num13 == num14)
{
num13 = ex.Next(2, 100);
num14 = ex.Next(2, 100);
}
}
sum5 = num13 num14;
break;
case 2:
ysf5 = "-";
while (num13 % num14 != 0)
{
num13 = ex.Next(2, 100);
num14 = ex.Next(2, 100);
while (num13 == num14)
{
num13 = ex.Next(2, 100);
num14 = ex.Next(2, 100);
}
}
sum5 = num13 - num14;
break;
case 3:
ysf5 = "X";
while (num13 % num14 != 0)
{
num13 = ex.Next(2, 20);
num14 = ex.Next(2, 10);
while (num13 == num14)
{
num13 = ex.Next(2, 20);
num14 = ex.Next(2, 10);
}
}
sum5 = num13 * num14;
break;
case 4:
ysf5 = "÷";
while (num13 % num14 != 0)
{
num13 = ex.Next(2, 100);
num14 = ex.Next(2, 100);
while (num13 == num14)
{
num13 = ex.Next(2, 100);
num14 = ex.Next(2, 100);
}
}
sum5 = num13 / num14;
break;
}
textBox9.Text = num13.ToString() " " ysf5 " " num14.ToString() " " "=";
switch (num18)
{
case 1:
ysf6 = " ";
while (num16 % num17 != 0)
{
num16 = ex.Next(2, 100);
num17 = ex.Next(2, 100);
while (num16 == num17)
{
num16 = ex.Next(2, 100);
num17 = ex.Next(2, 100);
}
}
sum6 = num16 num17;
break;
case 2:
ysf6 = "-";
while (num16 % num17 != 0)
{
num16 = ex.Next(2, 100);
num17 = ex.Next(2, 100);
while (num16 == num17)
{
num16 = ex.Next(2, 100);
num17 = ex.Next(2, 100);
}
}
sum6 = num16 - num17;
break;
case 3:
ysf6 = "X";
while (num16 % num17 != 0)
{
num16 = ex.Next(2, 20);
num17 = ex.Next(2, 10);
while (num16 == num17)
{
num16 = ex.Next(2, 20);
num17 = ex.Next(2, 10);
}
}
sum6 = num16 * num17;
break;
case 4:
ysf6 = "÷";
while (num16 % num17 != 0)
{
num16 = ex.Next(2, 100);
num17 = ex.Next(2, 100);
while (num16 == num17)
{
num16 = ex.Next(2, 100);
num17 = ex.Next(2, 100);
}
}
sum6 = num16 / num17;
break;
}
textBox11.Text = num16.ToString() " " ysf6 " " num17.ToString() " " "=";
switch (num21)
{
case 1:
ysf7 = " ";
while (num19 % num20 != 0)
{
num19 = ex.Next(2, 100);
num20 = ex.Next(2, 100);
while (num19 == num20)
{
num19 = ex.Next(2, 100);
num20 = ex.Next(2, 100);
}
}
sum7 = num19 num20;
break;
case 2:
ysf7 = "-";
while (num19 % num20 != 0)
{
num19 = ex.Next(2, 100);
num20 = ex.Next(2, 100);
while (num19 == num20)
{
num19 = ex.Next(2, 100);
num20 = ex.Next(2, 100);
}
}
sum7 = num19 - num20;
break;
case 3:
ysf7 = "X";
while (num19 % num20 != 0)
{
num19 = ex.Next(2, 20);
num20 = ex.Next(2, 10);
while (num19 == num20)
{
num19 = ex.Next(2, 20);
num20 = ex.Next(2, 10);
}
}
sum7 = num19 * num20;
break;
case 4:
ysf7 = "÷";
while (num19 % num20 != 0)
{
num19 = ex.Next(2, 100);
num20 = ex.Next(2, 100);
while (num19 == num20)
{
num19 = ex.Next(2, 100);
num20 = ex.Next(2, 100);
}
}
sum7 = num19 / num20;
break;
}
textBox13.Text = num19.ToString() " " ysf7 " " num20.ToString() " " "=";
switch (num24)
{
case 1:
ysf8 = " ";
while (num22 % num23 != 0)
{
num22 = ex.Next(2, 100);
num23 = ex.Next(2, 100);
while (num22 == num23)
{
num22 = ex.Next(2, 100);
num23 = ex.Next(2, 100);
}
}
sum8 = num22 num23;
break;
case 2:
ysf8 = "-";
while (num22 % num23 != 0)
{
num22 = ex.Next(2, 100);
num23 = ex.Next(2, 100);
while (num22 == num23)
{
num22 = ex.Next(2, 100);
num23 = ex.Next(2, 100);
}
}
sum8 = num22 - num23;
break;
case 3:
ysf8 = "X";
while (num22 % num23 != 0)
{
num22 = ex.Next(2, 20);
num23 = ex.Next(2, 10);
while (num22 == num23)
{
num22 = ex.Next(2, 20);
num23 = ex.Next(2, 10);
}
}
sum8 = num22 * num23;
break;
case 4:
ysf8 = "÷";
while (num22 % num23 != 0)
{
num22 = ex.Next(2, 100);
num23 = ex.Next(2, 100);
while (num22 == num23)
{
num22 = ex.Next(2, 100);
num23 = ex.Next(2, 100);
}
}
sum8 = num22 / num23;
break;
}
textBox15.Text = num22.ToString() " " ysf8 " " num23.ToString() " " "=";
switch (num27)
{
case 1:
ysf9 = " ";
while (num25 % num26 != 0)
{
num25 = ex.Next(2, 100);
num26 = ex.Next(2, 100);
while (num25 == num26)
{
num25 = ex.Next(2, 100);
num26 = ex.Next(2, 100);
}
}
sum9 = num25 num26;
break;
case 2:
ysf9 = "-";
while (num25 % num26 != 0)
{
num25 = ex.Next(2, 100);
num26 = ex.Next(2, 100);
while (num25 == num26)
{
num25 = ex.Next(2, 100);
num26 = ex.Next(2, 100);
}
}
sum9 = num25 - num26;
break;
case 3:
ysf9 = "X";
while (num25 % num26 != 0)
{
num25 = ex.Next(2, 20);
num26 = ex.Next(2, 10);
while (num25 == num26)
{
num25 = ex.Next(2, 20);
num26 = ex.Next(2, 10);
}
}
sum9 = num25 * num26;
break;
case 4:
ysf9 = "÷";
while (num25 % num26 != 0)
{
num25 = ex.Next(2, 100);
num26 = ex.Next(2, 100);
while (num25 == num26)
{
num25 = ex.Next(2, 100);
num26 = ex.Next(2, 100);
}
}
sum9 = num25 / num26;
break;
}
textBox17.Text = num25.ToString() " " ysf9 " " num26.ToString() " " "=";
switch (num30)
{
case 1:
ysf10 = " ";
while (num28 % num29 != 0)
{
num28 = ex.Next(2, 100);
num29 = ex.Next(2, 100);
while (num28 == num29)
{
num28 = ex.Next(2, 100);
num29 = ex.Next(2, 100);
}
}
sum10 = num28 num29;
break;
case 2:
ysf10 = "-";
while (num28 % num29 != 0)
{
num28 = ex.Next(2, 100);
num29 = ex.Next(2, 100);
while (num28 == num29)
{
num28 = ex.Next(2, 100);
num29 = ex.Next(2, 100);
}
}
sum10 = num28 - num29;
break;
case 3:
ysf10 = "X";
while (num28 % num29 != 0)
{
num28 = ex.Next(2, 20);
num29 = ex.Next(2, 10);
while (num28 == num29)
{
num28 = ex.Next(2, 20);
num29 = ex.Next(2, 10);
}
}
sum10 = num28 * num29;
break;
case 4:
ysf10 = "÷";
while (num28 % num29 != 0)
{
num28 = ex.Next(2, 100);
num29 = ex.Next(2, 100);
while (num28 == num29)
{
num28 = ex.Next(2, 100);
num29 = ex.Next(2, 100);
}
}
sum10 = num28 / num29;
break;
}
textBox19.Text = num28.ToString() " " ysf10 " " num29.ToString() " " "=";
switch (num33)
{
case 1:
ysf11 = " ";
while (num31 % num32 != 0)
{
num31 = ex.Next(2, 100);
num32 = ex.Next(2, 100);
while (num31 == num32)
{
num31 = ex.Next(2, 100);
num32 = ex.Next(2, 100);
}
}
sum11 = num31 num32;
break;
case 2:
ysf11 = "-";
while (num31 % num32 != 0)
{
num31 = ex.Next(2, 100);
num32 = ex.Next(2, 100);
while (num31 == num32)
{
num31 = ex.Next(2, 100);
num32 = ex.Next(2, 100);
}
}
sum11 = num31 - num32;
break;
case 3:
ysf11 = "X";
while (num31 % num32 != 0)
{
num31 = ex.Next(2, 20);
num32 = ex.Next(2, 10);
while (num31 == num32)
{
num31 = ex.Next(2, 20);
num32 = ex.Next(2, 10);
}
}
sum11 = num31 * num32;
break;
case 4:
ysf11 = "÷";
while (num31 % num32 != 0)
{
num31 = ex.Next(2, 100);
num32 = ex.Next(2, 100);
while (num31 == num32)
{
num31 = ex.Next(2, 100);
num32 = ex.Next(2, 100);
}
}
sum11 = num31 / num32;
break;
}
textBox21.Text = num31.ToString() " " ysf11 " " num32.ToString() " " "=";
switch (num36)
{
case 1:
ysf12 = " ";
while (num34 % num35 != 0)
{
num34 = ex.Next(2, 100);
num35 = ex.Next(2, 100);
while (num34 == num35)
{
num34 = ex.Next(2, 100);
num35 = ex.Next(2, 100);
}
}
sum12 = num34 num35;
break;
case 2:
ysf12 = "-";
while (num34 % num35 != 0)
{
num34 = ex.Next(2, 100);
num35 = ex.Next(2, 100);
while (num34 == num35)
{
num34 = ex.Next(2, 100);
num35 = ex.Next(2, 100);
}
}
sum12 = num34 - num35;
break;
case 3:
ysf12 = "X";
while (num34 % num35 != 0)
{
num34 = ex.Next(2, 20);
num35 = ex.Next(2, 10);
while (num34 == num35)
{
num34 = ex.Next(2, 20);
num35 = ex.Next(2, 10);
}
}
sum12 = num34 * num35;
break;
case 4:
ysf12 = "÷";
while (num34 % num35 != 0)
{
num34 = ex.Next(2, 100);
num35 = ex.Next(2, 100);
while (num34 == num35)
{
num34 = ex.Next(2, 100);
num35 = ex.Next(2, 100);
}
}
sum12 = num34 / num35;
break;
}
textBox23.Text = num34.ToString() " " ysf12 " " num35.ToString() " " "=";
switch (num39)
{
case 1:
ysf13 = " ";
while (num37 % num38 != 0)
{
num37 = ex.Next(2, 100);
num38 = ex.Next(2, 100);
while (num37 == num38)
{
num37 = ex.Next(2, 100);
num38 = ex.Next(2, 100);
}
}
sum13 = num37 num38;
break;
case 2:
ysf13 = "-";
while (num37 % num38 != 0)
{
num37 = ex.Next(2, 100);
num38 = ex.Next(2, 100);
while (num37 == num38)
{
num37 = ex.Next(2, 100);
num38 = ex.Next(2, 100);
}
}
sum13 = num37 - num38;
break;
case 3:
ysf13 = "X";
while (num37 % num38 != 0)
{
num37 = ex.Next(2, 20);
num38 = ex.Next(2, 10);
while (num37 == num38)
{
num37 = ex.Next(2, 20);
num38 = ex.Next(2, 10);
}
}
sum13 = num37 * num38;
break;
case 4:
ysf13 = "÷";
while (num37 % num38 != 0)
{
num37 = ex.Next(2, 100);
num38 = ex.Next(2, 100);
while (num37 == num38)
{
num37 = ex.Next(2, 100);
num38 = ex.Next(2, 100);
}
}
sum13 = num37 / num38;
break;
}
textBox25.Text = num37.ToString() " " ysf13 " " num38.ToString() " " "=";
switch (num42)
{
case 1:
ysf14 = " ";
while (num40 % num41 != 0)
{
num40 = ex.Next(2, 100);
num41 = ex.Next(2, 100);
while (num40 == num41)
{
num40 = ex.Next(2, 100);
num41 = ex.Next(2, 100);
}
}
sum14 = num40 num41;
break;
case 2:
ysf14 = "-";
while (num40 % num41 != 0)
{
num40 = ex.Next(2, 100);
num41 = ex.Next(2, 100);
while (num40 == num41)
{
num40 = ex.Next(2, 100);
num41 = ex.Next(2, 100);
}
}
sum14 = num40 - num41;
break;
case 3:
ysf14 = "X";
while (num40 % num41 != 0)
{
num40 = ex.Next(2, 20);
num41 = ex.Next(2, 10);
while (num40 == num41)
{
num40 = ex.Next(2, 20);
num41 = ex.Next(2, 10);
}
}
sum14 = num40 * num41;
break;
case 4:
ysf14 = "÷";
while (num40 % num41 != 0)
{
num40 = ex.Next(2, 100);
num41 = ex.Next(2, 100);
while (num40 == num41)
{
num40 = ex.Next(2, 100);
num41 = ex.Next(2, 100);
}
}
sum14 = num40 / num41;
break;
}
textBox27.Text = num40.ToString() " " ysf14 " " num41.ToString() " " "=";
switch (num45)
{
case 1:
ysf15 = " ";
while (num43 % num44 != 0)
{
num43 = ex.Next(2, 100);
num44 = ex.Next(2, 100);
while (num43 == num44)
{
num43 = ex.Next(2, 100);
num44 = ex.Next(2, 100);
}
}
sum15 = num43 num44;
break;
case 2:
ysf15 = "-";
while (num43 % num44 != 0)
{
num43 = ex.Next(2, 100);
num44 = ex.Next(2, 100);
while (num43 == num44)
{
num43 = ex.Next(2, 100);
num44 = ex.Next(2, 100);
}
}
sum15 = num43 - num44;
break;
case 3:
ysf15 = "X";
while (num43 % num44 != 0)
{
num43 = ex.Next(2, 20);
num44 = ex.Next(2, 10);
while (num43 == num44)
{
num43 = ex.Next(2, 20);
num44 = ex.Next(2, 10);
}
}
sum15 = num43 * num44;
break;
case 4:
ysf15 = "÷";
while (num43 % num44 != 0)
{
num43 = ex.Next(2, 100);
num44 = ex.Next(2, 100);
while (num43 == num44)
{
num43 = ex.Next(2, 100);
num44 = ex.Next(2, 100);
}
}
sum15 = num43 / num44;
break;
}
textBox29.Text = num43.ToString() " " ysf15 " " num44.ToString() " " "=";
switch (num48)
{
case 1:
ysf16 = " ";
while (num46 % num47 != 0)
{
num46 = ex.Next(2, 100);
num47 = ex.Next(2, 100);
while (num46 == num47)
{
num46 = ex.Next(2, 100);
num47 = ex.Next(2, 100);
}
}
sum16 = num46 num47;
break;
case 2:
ysf16 = "-";
while (num46 % num47 != 0)
{
num46 = ex.Next(2, 100);
num47 = ex.Next(2, 100);
while (num46 == num47)
{
num46 = ex.Next(2, 100);
num47 = ex.Next(2, 100);
}
}
sum16 = num46 - num47;
break;
case 3:
ysf16 = "X";
while (num46 % num47 != 0)
{
num46 = ex.Next(2, 20);
num47 = ex.Next(2, 10);
while (num46 == num47)
{
num46 = ex.Next(2, 20);
num47 = ex.Next(2, 10);
}
}
sum16 = num46 * num47;
break;
case 4:
ysf16 = "÷";
while (num46 % num47 != 0)
{
num46 = ex.Next(2, 100);
num47 = ex.Next(2, 100);
while (num46 == num47)
{
num46 = ex.Next(2, 100);
num47 = ex.Next(2, 100);
}
}
sum16 = num46 / num47;
break;
}
textBox31.Text = num46.ToString() " " ysf16 " " num47.ToString() " " "=";
switch (num51)
{
case 1:
ysf17 = " ";
while (num49 % num50 != 0)
{
num49 = ex.Next(2, 100);
num50 = ex.Next(2, 100);
while (num49 == num50)
{
num49 = ex.Next(2, 100);
num50 = ex.Next(2, 100);
}
}
sum17 = num49 num50;
break;
case 2:
ysf17 = "-";
while (num49 % num50 != 0)
{
num49 = ex.Next(2, 100);
num50 = ex.Next(2, 100);
while (num49 == num50)
{
num49 = ex.Next(2, 100);
num50 = ex.Next(2, 100);
}
}
sum17 = num49 - num50;
break;
case 3:
ysf17 = "X";
while (num49 % num50 != 0)
{
num49 = ex.Next(2, 20);
num50 = ex.Next(2, 10);
while (num49 == num50)
{
num49 = ex.Next(2, 20);
num50 = ex.Next(2, 10);
}
}
sum17 = num49 * num50;
break;
case 4:
ysf17 = "÷";
while (num49 % num50 != 0)
{
num49 = ex.Next(2, 100);
num50 = ex.Next(2, 100);
while (num49 == num50)
{
num49 = ex.Next(2, 100);
num50 = ex.Next(2, 100);
}
}
sum17 = num49 / num50;
break;
}
textBox33.Text = num49.ToString() " " ysf17 " " num50.ToString() " " "=";
switch (num54)
{
case 1:
ysf18 = " ";
while (num52 % num53 != 0)
{
num52 = ex.Next(2, 100);
num53 = ex.Next(2, 100);
while (num52 == num53)
{
num52 = ex.Next(2, 100);
num53 = ex.Next(2, 100);
}
}
sum18 = num52 num53;
break;
case 2:
ysf18 = "-";
while (num52 % num53 != 0)
{
num52 = ex.Next(2, 100);
num53 = ex.Next(2, 100);
while (num52 == num53)
{
num52 = ex.Next(2, 100);
num53 = ex.Next(2, 100);
}
}
sum18 = num52 - num53;
break;
case 3:
ysf18 = "X";
while (num52 % num53 != 0)
{
num52 = ex.Next(2, 20);
num53 = ex.Next(2, 10);
while (num52 == num53)
{
num52 = ex.Next(2, 20);
num53 = ex.Next(2, 10);
}
}
sum18 = num52 * num53;
break;
case 4:
ysf18 = "÷";
while (num52 % num53 != 0)
{
num52 = ex.Next(2, 100);
num53 = ex.Next(2, 100);
while (num52 == num53)
{
num52 = ex.Next(2, 100);
num53 = ex.Next(2, 100);
}
}
sum18 = num52 / num53;
break;
}
textBox35.Text = num52.ToString() " " ysf18 " " num53.ToString() " " "=";
switch (num57)
{
case 1:
ysf19 = " ";
while (num55 % num56 != 0)
{
num55 = ex.Next(2, 100);
num56 = ex.Next(2, 100);
while (num55 == num56)
{
num55 = ex.Next(2, 100);
num56 = ex.Next(2, 100);
}
}
sum19 = num55 num56;
break;
case 2:
ysf19 = "-";
while (num55 % num56 != 0)
{
num55 = ex.Next(2, 100);
num56 = ex.Next(2, 100);
while (num55 == num56)
{
num55 = ex.Next(2, 100);
num56 = ex.Next(2, 100);
}
}
sum19 = num55 - num56;
break;
case 3:
ysf19 = "X";
while (num55 % num56 != 0)
{
num55 = ex.Next(2, 20);
num56 = ex.Next(2, 10);
while (num55 == num56)
{
num55 = ex.Next(2, 20);
num56 = ex.Next(2, 10);
}
}
sum19 = num55 * num56;
break;
case 4:
ysf19 = "÷";
while (num55 % num56 != 0)
{
num55 = ex.Next(2, 100);
num56 = ex.Next(2, 100);
while (num55 == num56)
{
num55 = ex.Next(2, 100);
num56 = ex.Next(2, 100);
}
}
sum19 = num55 / num56;
break;
}
textBox37.Text = num55.ToString() " " ysf19 " " num56.ToString() " " "=";
switch (num60)
{
case 1:
ysf20 = " ";
while (num58 % num59 != 0)
{
num58 = ex.Next(2, 100);
num59 = ex.Next(2, 100);
while (num58 == num59)
{
num58 = ex.Next(2, 100);
num59 = ex.Next(2, 100);
}
}
sum20 = num58 num59;
break;
case 2:
ysf20 = "-";
while (num58 % num59 != 0)
{
num58 = ex.Next(2, 100);
num59 = ex.Next(2, 100);
while (num58 == num59)
{
num58 = ex.Next(2, 100);
num59 = ex.Next(2, 100);
}
}
sum20 = num58 - num59;
break;
case 3:
ysf20 = "X";
while (num58 % num59 != 0)
{
num58 = ex.Next(2, 20);
num59 = ex.Next(2, 10);
while (num58 == num59)
{
num58 = ex.Next(2, 20);
num59 = ex.Next(2, 10);
}
}
sum20 = num58 * num59;
break;
case 4:
ysf20 = "÷";
while (num58 % num59 != 0)
{
num58 = ex.Next(2, 100);
num59 = ex.Next(2, 100);
while (num58 == num59)
{
num58 = ex.Next(2, 100);
num59 = ex.Next(2, 100);
}
}
sum20 = num58 / num59;
break;
}
textBox39.Text = num58.ToString() " " ysf20 " " num59.ToString() " " "=";
switch (num63)
{
case 1:
ysf21 = " ";
while (num61 % num62 != 0)
{
num61 = ex.Next(2, 100);
num62 = ex.Next(2, 100);
while (num61 == num62)
{
num61 = ex.Next(2, 100);
num62 = ex.Next(2, 100);
}
}
sum21 = num61 num62;
break;
case 2:
ysf21 = "-";
while (num61 % num62 != 0)
{
num61 = ex.Next(2, 100);
num62 = ex.Next(2, 100);
while (num61 == num62)
{
num61 = ex.Next(2, 100);
num62 = ex.Next(2, 100);
}
}
sum21 = num61 - num62;
break;
case 3:
ysf21 = "X";
while (num61 % num62 != 0)
{
num61 = ex.Next(2, 20);
num62 = ex.Next(2, 10);
while (num61 == num62)
{
num61 = ex.Next(2, 20);
num62 = ex.Next(2, 10);
}
}
sum21 = num61 * num62;
break;
case 4:
ysf21 = "÷";
while (num61 % num62 != 0)
{
num61 = ex.Next(2, 100);
num62 = ex.Next(2, 100);
while (num61 == num62)
{
num61 = ex.Next(2, 100);
num62 = ex.Next(2, 100);
}
}
sum21 = num61 / num62;
break;
}
textBox41.Text = num61.ToString() " " ysf21 " " num62.ToString() " " "=";
switch (num66)
{
case 1:
ysf22 = " ";
while (num64 % num65 != 0)
{
num64 = ex.Next(2, 100);
num65 = ex.Next(2, 100);
while (num64 == num65)
{
num64 = ex.Next(2, 100);
num65 = ex.Next(2, 100);
}
}
sum22 = num64 num65;
break;
case 2:
ysf22 = "-";
while (num64 % num65 != 0)
{
num64 = ex.Next(2, 100);
num65 = ex.Next(2, 100);
while (num64 == num65)
{
num64 = ex.Next(2, 100);
num65 = ex.Next(2, 100);
}
}
sum22 = num64 - num65;
break;
case 3:
ysf22 = "X";
while (num64 % num65 != 0)
{
num64 = ex.Next(2, 20);
num65 = ex.Next(2, 10);
while (num64 == num65)
{
num64 = ex.Next(2, 20);
num65 = ex.Next(2, 10);
}
}
sum22 = num64 * num65;
break;
case 4:
ysf22 = "÷";
while (num64 % num65 != 0)
{
num64 = ex.Next(2, 100);
num65 = ex.Next(2, 100);
while (num64 == num65)
{
num64 = ex.Next(2, 100);
num65 = ex.Next(2, 100);
}
}
sum22 = num64 / num65;
break;
}
textBox43.Text = num64.ToString() " " ysf22 " " num65.ToString() " " "=";
switch (num69)
{
case 1:
ysf23 = " ";
while (num67 % num68 != 0)
{
num67 = ex.Next(2, 100);
num68 = ex.Next(2, 100);
while (num67 == num68)
{
num67 = ex.Next(2, 100);
num68 = ex.Next(2, 100);
}
}
sum23 = num67 num68;
break;
case 2:
ysf23 = "-";
while (num67 % num68 != 0)
{
num67 = ex.Next(2, 100);
num68 = ex.Next(2, 100);
while (num67 == num68)
{
num67 = ex.Next(2, 100);
num68 = ex.Next(2, 100);
}
}
sum23 = num67 - num68;
break;
case 3:
ysf23 = "X";
while (num67 % num68 != 0)
{
num67 = ex.Next(2, 20);
num68 = ex.Next(2, 10);
while (num67 == num68)
{
num67 = ex.Next(2, 20);
num68 = ex.Next(2, 10);
}
}
sum23 = num67 * num68;
break;
case 4:
ysf23 = "÷";
while (num67 % num68 != 0)
{
num67 = ex.Next(2, 100);
num68 = ex.Next(2, 100);
while (num67 == num68)
{
num67 = ex.Next(2, 100);
num68 = ex.Next(2, 100);
}
}
sum23 = num67 / num68;
break;
}
textBox45.Text = num67.ToString() " " ysf23 " " num68.ToString() " " "=";
switch (num72)
{
case 1:
ysf24 = " ";
while (num70 % num71 != 0)
{
num70 = ex.Next(2, 100);
num71 = ex.Next(2, 100);
while (num70 == num71)
{
num70 = ex.Next(2, 100);
num71 = ex.Next(2, 100);
}
}
sum24 = num70 num71;
break;
case 2:
ysf24 = "-";
while (num70 % num71 != 0)
{
num70 = ex.Next(2, 100);
num71 = ex.Next(2, 100);
while (num70 == num71)
{
num70 = ex.Next(2, 100);
num71 = ex.Next(2, 100);
}
}
sum24 = num70 - num71;
break;
case 3:
ysf24 = "X";
while (num70 % num71 != 0)
{
num70 = ex.Next(2, 20);
num71 = ex.Next(2, 10);
while (num70 == num71)
{
num70 = ex.Next(2, 20);
num71 = ex.Next(2, 10);
}
}
sum24 = num70 * num71;
break;
case 4:
ysf24 = "÷";
while (num70 % num71 != 0)
{
num70 = ex.Next(2, 100);
num71 = ex.Next(2, 100);
while (num70 == num71)
{
num70 = ex.Next(2, 100);
num71 = ex.Next(2, 100);
}
}
sum24 = num70 / num71;
break;
}
textBox47.Text = num70.ToString() " " ysf24 " " num71.ToString() " " "=";
switch (num75)
{
case 1:
ysf25 = " ";
while (num73 % num74 != 0)
{
num73 = ex.Next(2, 100);
num74 = ex.Next(2, 100);
while (num73 == num74)
{
num73 = ex.Next(2, 100);
num74 = ex.Next(2, 100);
}
}
sum25 = num73 num74;
break;
case 2:
ysf25 = "-";
while (num73 % num74 != 0)
{
num73 = ex.Next(2, 100);
num74 = ex.Next(2, 100);
while (num73 == num74)
{
num73 = ex.Next(2, 100);
num74 = ex.Next(2, 100);
}
}
sum25 = num73 - num74;
break;
case 3:
ysf25 = "X";
while (num73 % num74 != 0)
{
num73 = ex.Next(2, 20);
num74 = ex.Next(2, 10);
while (num73 == num74)
{
num73 = ex.Next(2, 20);
num74 = ex.Next(2, 10);
}
}
sum25 = num73 * num74;
break;
case 4:
ysf25 = "÷";
while (num73 % num74 != 0)
{
num73 = ex.Next(2, 100);
num74 = ex.Next(2, 100);
while (num73 == num74)
{
num73 = ex.Next(2, 100);
num74 = ex.Next(2, 100);
}
}
sum25 = num73 / num74;
break;
}
textBox49.Text = num73.ToString() " " ysf25 " " num74.ToString() " " "=";
switch (num78)
{
case 1:
ysf26 = " ";
while (num76 % num77 != 0)
{
num76 = ex.Next(2, 100);
num77 = ex.Next(2, 100);
while (num76 == num77)
{
num76 = ex.Next(2, 100);
num77 = ex.Next(2, 100);
}
}
sum26 = num76 num77;
break;
case 2:
ysf26 = "-";
while (num76 % num77 != 0)
{
num76 = ex.Next(2, 100);
num77 = ex.Next(2, 100);
while (num76 == num77)
{
num76 = ex.Next(2, 100);
num77 = ex.Next(2, 100);
}
}
sum26 = num76 - num77;
break;
case 3:
ysf26 = "X";
while (num76 % num77 != 0)
{
num76 = ex.Next(2, 20);
num77 = ex.Next(2, 10);
while (num76 == num77)
{
num76 = ex.Next(2, 20);
num77 = ex.Next(2, 10);
}
}
sum26 = num76 * num77;
break;
case 4:
ysf26 = "÷";
while (num76 % num77 != 0)
{
num76 = ex.Next(2, 100);
num77 = ex.Next(2, 100);
while (num76 == num77)
{
num76 = ex.Next(2, 100);
num77 = ex.Next(2, 100);
}
}
sum26 = num76 / num77;
break;
}
textBox51.Text = num76.ToString() " " ysf26 " " num77.ToString() " " "=";
switch (num81)
{
case 1:
ysf27 = " ";
while (num79 % num80 != 0)
{
num79 = ex.Next(2, 100);
num80 = ex.Next(2, 100);
while (num79 == num80)
{
num79 = ex.Next(2, 100);
num80 = ex.Next(2, 100);
}
}
sum27 = num79 num80;
break;
case 2:
ysf27 = "-";
while (num79 % num80 != 0)
{
num79 = ex.Next(2, 100);
num80 = ex.Next(2, 100);
while (num79 == num80)
{
num79 = ex.Next(2, 100);
num80 = ex.Next(2, 100);
}
}
sum27 = num79 - num80;
break;
case 3:
ysf27 = "X";
while (num79 % num80 != 0)
{
num79 = ex.Next(2, 20);
num80 = ex.Next(2, 10);
while (num79 == num80)
{
num79 = ex.Next(2, 20);
num80 = ex.Next(2, 10);
}
}
sum27 = num79 * num80;
break;
case 4:
ysf27 = "÷";
while (num79 % num80 != 0)
{
num79 = ex.Next(2, 100);
num80 = ex.Next(2, 100);
while (num79 == num80)
{
num79 = ex.Next(2, 100);
num80 = ex.Next(2, 100);
}
}
sum27 = num79 / num80;
break;
}
textBox53.Text = num79.ToString() " " ysf27 " " num80.ToString() " " "=";
switch (num84)
{
case 1:
ysf28 = " ";
while (num82 % num83 != 0)
{
num82 = ex.Next(2, 100);
num83 = ex.Next(2, 100);
while (num82 == num83)
{
num82 = ex.Next(2, 100);
num83 = ex.Next(2, 100);
}
}
sum28 = num82 num83;
break;
case 2:
ysf28 = "-";
while (num82 % num83 != 0)
{
num82 = ex.Next(2, 100);
num83 = ex.Next(2, 100);
while (num82 == num83)
{
num82 = ex.Next(2, 100);
num83 = ex.Next(2, 100);
}
}
sum28 = num82 - num83;
break;
case 3:
ysf28 = "X";
while (num82 % num83 != 0)
{
num82 = ex.Next(2, 20);
num83 = ex.Next(2, 10);
while (num82 == num83)
{
num82 = ex.Next(2, 20);
num83 = ex.Next(2, 10);
}
}
sum28 = num82 * num83;
break;
case 4:
ysf28 = "÷";
while (num82 % num83 != 0)
{
num82 = ex.Next(2, 100);
num83 = ex.Next(2, 100);
while (num82 == num83)
{
num82 = ex.Next(2, 100);
num83 = ex.Next(2, 100);
}
}
sum28 = num82 / num83;
break;
}
textBox55.Text = num82.ToString() " " ysf28 " " num83.ToString() " " "=";
switch (num87)
{
case 1:
ysf29 = " ";
while (num85 % num86 != 0)
{
num85 = ex.Next(2, 100);
num86 = ex.Next(2, 100);
while (num85 == num86)
{
num85 = ex.Next(2, 100);
num86 = ex.Next(2, 100);
}
}
sum29 = num85 num86;
break;
case 2:
ysf29 = "-";
while (num85 % num86 != 0)
{
num85 = ex.Next(2, 100);
num86 = ex.Next(2, 100);
while (num85 == num86)
{
num85 = ex.Next(2, 100);
num86 = ex.Next(2, 100);
}
}
sum29 = num85 - num86;
break;
case 3:
ysf29 = "X";
while (num85 % num86 != 0)
{
num85 = ex.Next(2, 20);
num86 = ex.Next(2, 10);
while (num85 == num86)
{
num85 = ex.Next(2, 20);
num86 = ex.Next(2, 10);
}
}
sum29 = num85 * num86;
break;
case 4:
ysf29 = "÷";
while (num85 % num86 != 0)
{
num85 = ex.Next(2, 100);
num86 = ex.Next(2, 100);
while (num85 == num86)
{
num85 = ex.Next(2, 100);
num86 = ex.Next(2, 100);
}
}
sum29 = num85 / num86;
break;
}
textBox57.Text = num85.ToString() " " ysf29 " " num86.ToString() " " "=";
switch (num90)
{
case 1:
ysf30 = " ";
while (num88 % num89 != 0)
{
num88 = ex.Next(2, 100);
num89 = ex.Next(2, 100);
while (num88 == num89)
{
num88 = ex.Next(2, 100);
num89 = ex.Next(2, 100);
}
}
sum30 = num88 num89;
break;
case 2:
ysf30 = "-";
while (num88 % num89 != 0)
{
num88 = ex.Next(2, 100);
num89 = ex.Next(2, 100);
while (num88 == num89)
{
num88 = ex.Next(2, 100);
num89 = ex.Next(2, 100);
}
}
sum30 = num88 - num89;
break;
case 3:
ysf30 = "X";
while (num88 % num89 != 0)
{
num88 = ex.Next(2, 20);
num89 = ex.Next(2, 10);
while (num88 == num89)
{
num88 = ex.Next(2, 20);
num89 = ex.Next(2, 10);
}
}
sum30 = num88 * num89;
break;
case 4:
ysf30 = "÷";
while (num88 % num89 != 0)
{
num88 = ex.Next(2, 100);
num89 = ex.Next(2, 100);
while (num88 == num89)
{
num88 = ex.Next(2, 100);
num89 = ex.Next(2, 100);
}
}
sum30 = num88 / num89;
break;
}
textBox59.Text = num88.ToString() " " ysf30 " " num89.ToString() " " "=";
if (this.timer1.Enabled == false)
{
currentCount_h = 0;
currentCount_m = 0;
currentCount_s = 0;
this.timer1.Enabled = true;
//button3.Text = "停止计时";
}
}
private void button2_Click(object sender, EventArgs e)
{
if (textBox2.Text == "")
{
textBox2.Text = "0";
}
if (textBox4.Text == "")
{
textBox4.Text = "0";
}
if (textBox6.Text == "")
{
textBox6.Text = "0";
}
if (textBox8.Text == "")
{
textBox8.Text = "0";
}
if (textBox10.Text == "")
{
textBox10.Text = "0";
}
if (textBox12.Text == "")
{
textBox12.Text = "0";
}
if (textBox14.Text == "")
{
textBox14.Text = "0";
}
if (textBox16.Text == "")
{
textBox16.Text = "0";
}
if (textBox18.Text == "")
{
textBox18.Text = "0";
}
if (textBox20.Text == "")
{
textBox20.Text = "0";
}
if (textBox22.Text == "")
{
textBox22.Text = "0";
}
if (textBox24.Text == "")
{
textBox24.Text = "0";
}
if (textBox26.Text == "")
{
textBox26.Text = "0";
}
if (textBox28.Text == "")
{
textBox28.Text = "0";
}
if (textBox30.Text == "")
{
textBox30.Text = "0";
}
if (textBox32.Text == "")
{
textBox32.Text = "0";
}
if (textBox34.Text == "")
{
textBox34.Text = "0";
}
if (textBox36.Text == "")
{
textBox36.Text = "0";
}
if (textBox38.Text == "")
{
textBox38.Text = "0";
}
if (textBox40.Text == "")
{
textBox40.Text = "0";
}
if (textBox42.Text == "")
{
textBox42.Text = "0";
}
if (textBox44.Text == "")
{
textBox44.Text = "0";
}
if (textBox46.Text == "")
{
textBox46.Text = "0";
}
if (textBox48.Text == "")
{
textBox48.Text = "0";
}
if (textBox50.Text == "")
{
textBox50.Text = "0";
}
if (textBox52.Text == "")
{
textBox52.Text = "0";
}
if (textBox54.Text == "")
{
textBox54.Text = "0";
}
if (textBox56.Text == "")
{
textBox56.Text = "0";
}
if (textBox58.Text == "")
{
textBox58.Text = "0";
}
if (textBox60.Text == "")
{
textBox60.Text = "0";
}
try
{
double a = double.Parse(textBox60.Text);
}
catch (Exception)
{
textBox60.Text = " ";
return;
}
if (int.Parse(textBox2.Text.Trim()) == sum1)
{
textBox2.Text = textBox2.Text " " "√" " " sum1;
textBox2.ForeColor = Color.Green;
}
else
{
textBox2.Text = textBox2.Text " " "X" " " sum1;
textBox2.ForeColor = Color.Red;
}
if (int.Parse(textBox4.Text.Trim()) == sum2)
{
textBox4.Text = textBox4.Text " " "√" " " sum2;
textBox4.ForeColor = Color.Green;
}
else
{
textBox4.Text = textBox4.Text " " "X" " " sum2;
textBox4.ForeColor = Color.Red;
}
if (int.Parse(textBox6.Text.Trim()) == sum3)
{
textBox6.Text = textBox6.Text " " "√" " " sum3;
textBox6.ForeColor = Color.Green;
}
else
{
textBox6.Text = textBox6.Text " " "X" " " sum3;
textBox6.ForeColor = Color.Red;
}
if (int.Parse(textBox8.Text.Trim()) == sum4)
{
textBox8.Text = textBox8.Text " " "√" " " sum4;
textBox8.ForeColor = Color.Green;
}
else
{
textBox8.Text = textBox8.Text " " "X" " " sum4;
textBox8.ForeColor = Color.Red;
}
if (int.Parse(textBox10.Text.Trim()) == sum5)
{
textBox10.Text = textBox10.Text " " "√" " " sum5;
textBox10.ForeColor = Color.Green;
}
else
{
textBox10.Text = textBox10.Text " " "X" " " sum5;
textBox10.ForeColor = Color.Red;
}
if (int.Parse(textBox12.Text.Trim()) == sum6)
{
textBox12.Text = textBox12.Text " " "√" " " sum6;
textBox12.ForeColor = Color.Green;
}
else
{
textBox12.Text = textBox12.Text " " "X" " " sum6;
textBox12.ForeColor = Color.Red;
}
if (int.Parse(textBox14.Text.Trim()) == sum7)
{
textBox14.Text = textBox14.Text " " "√" " " sum7;
textBox14.ForeColor = Color.Green;
}
else
{
textBox14.Text = textBox14.Text " " "X" " " sum7;
textBox14.ForeColor = Color.Red;
}
if (int.Parse(textBox16.Text.Trim()) == sum8)
{
textBox16.Text = textBox16.Text " " "√" " " sum8;
textBox16.ForeColor = Color.Green;
}
else
{
textBox16.Text = textBox16.Text " " "X" " " sum8;
textBox16.ForeColor = Color.Red;
}
if (int.Parse(textBox18.Text.Trim()) == sum9)
{
textBox18.Text = textBox18.Text " " "√" " " sum9;
textBox18.ForeColor = Color.Green;
}
else
{
textBox18.Text = textBox18.Text " " "X" " " sum9;
textBox18.ForeColor = Color.Red;
}
if (int.Parse(textBox20.Text.Trim()) == sum10)
{
textBox20.Text = textBox20.Text " " "√" " " sum10;
textBox20.ForeColor = Color.Green;
}
else
{
textBox20.Text = textBox20.Text " " "X" " " sum10;
textBox20.ForeColor = Color.Red;
}
if (int.Parse(textBox22.Text.Trim()) == sum11)
{
textBox22.Text = textBox22.Text " " "√" " " sum11;
textBox22.ForeColor = Color.Green;
}
else
{
textBox22.Text = textBox22.Text " " "X" " " sum11;
textBox22.ForeColor = Color.Red;
}
if (int.Parse(textBox24.Text.Trim()) == sum12)
{
textBox24.Text = textBox24.Text " " "√" " " sum12;
textBox24.ForeColor = Color.Green;
}
else
{
textBox24.Text = textBox24.Text " " "X" " " sum12;
textBox24.ForeColor = Color.Red;
}
if (int.Parse(textBox26.Text.Trim()) == sum13)
{
textBox26.Text = textBox26.Text " " "√" " " sum13;
textBox26.ForeColor = Color.Green;
}
else
{
textBox26.Text = textBox26.Text " " "X" " " sum13;
textBox26.ForeColor = Color.Red;
}
if (int.Parse(textBox28.Text.Trim()) == sum14)
{
textBox28.Text = textBox28.Text " " "√" " " sum14;
textBox28.ForeColor = Color.Green;
}
else
{
textBox28.Text = textBox28.Text " " "X" " " sum14;
textBox28.ForeColor = Color.Red;
}
if (int.Parse(textBox30.Text.Trim()) == sum15)
{
textBox30.Text = textBox30.Text " " "√" " " sum15;
textBox30.ForeColor = Color.Green;
}
else
{
textBox30.Text = textBox30.Text " " "X" " " sum15;
textBox30.ForeColor = Color.Red;
}
if (int.Parse(textBox32.Text.Trim()) == sum16)
{
textBox32.Text = textBox32.Text " " "√" " " sum16;
textBox32.ForeColor = Color.Green;
}
else
{
textBox32.Text = textBox32.Text " " "X" " " sum16;
textBox32.ForeColor = Color.Red;
}
if (int.Parse(textBox34.Text.Trim()) == sum17)
{
textBox34.Text = textBox34.Text " " "√" " " sum17;
textBox34.ForeColor = Color.Green;
}
else
{
textBox34.Text = textBox34.Text " " "X" " " sum17;
textBox34.ForeColor = Color.Red;
}
if (int.Parse(textBox36.Text.Trim()) == sum18)
{
textBox36.Text = textBox36.Text " " "√" " " sum18;
textBox36.ForeColor = Color.Green;
}
else
{
textBox36.Text = textBox36.Text " " "X" " " sum18;
textBox36.ForeColor = Color.Red;
}
if (int.Parse(textBox38.Text.Trim()) == sum19)
{
textBox38.Text = textBox38.Text " " "√" " " sum19;
textBox38.ForeColor = Color.Green;
}
else
{
textBox38.Text = textBox38.Text " " "X" " " sum19;
textBox38.ForeColor = Color.Red;
}
if (int.Parse(textBox40.Text.Trim()) == sum20)
{
textBox40.Text = textBox40.Text " " "√" " " sum20;
textBox40.ForeColor = Color.Green;
}
else
{
textBox40.Text = textBox40.Text " " "X" " " sum20;
textBox40.ForeColor = Color.Red;
}
if (int.Parse(textBox42.Text.Trim()) == sum21)
{
textBox42.Text = textBox42.Text " " "√" " " sum21;
textBox42.ForeColor = Color.Green;
}
else
{
textBox42.Text = textBox42.Text " " "X" " " sum21;
textBox42.ForeColor = Color.Red;
}
if (int.Parse(textBox44.Text.Trim()) == sum22)
{
textBox44.Text = textBox44.Text " " "√" " " sum22;
textBox44.ForeColor = Color.Green;
}
else
{
textBox44.Text = textBox44.Text " " "X" " " sum22;
textBox44.ForeColor = Color.Red;
}
if (int.Parse(textBox46.Text.Trim()) == sum23)
{
textBox46.Text = textBox46.Text " " "√" " " sum23;
textBox46.ForeColor = Color.Green;
}
else
{
textBox46.Text = textBox46.Text " " "X" " " sum23;
textBox46.ForeColor = Color.Red;
}
if (int.Parse(textBox48.Text.Trim()) == sum24)
{
textBox48.Text = textBox48.Text " " "√" " " sum24;
textBox48.ForeColor = Color.Green;
}
else
{
textBox48.Text = textBox48.Text " " "X" " " sum24;
textBox48.ForeColor = Color.Red;
}
if (int.Parse(textBox50.Text.Trim()) == sum25)
{
textBox50.Text = textBox50.Text " " "√" " " sum25;
textBox50.ForeColor = Color.Green;
}
else
{
textBox50.Text = textBox50.Text " " "X" " " sum25;
textBox50.ForeColor = Color.Red;
}
if (int.Parse(textBox52.Text.Trim()) == sum26)
{
textBox52.Text = textBox52.Text " " "√" " " sum26;
textBox52.ForeColor = Color.Green;
}
else
{
textBox52.Text = textBox52.Text " " "X" " " sum26;
textBox52.ForeColor = Color.Red;
}
if (int.Parse(textBox54.Text.Trim()) == sum27)
{
textBox54.Text = textBox54.Text " " "√" " " sum27;
textBox54.ForeColor = Color.Green;
}
else
{
textBox54.Text = textBox54.Text " " "X" " " sum27;
textBox54.ForeColor = Color.Red;
}
if (int.Parse(textBox56.Text.Trim()) == sum28)
{
textBox56.Text = textBox56.Text " " "√" " " sum28;
textBox56.ForeColor = Color.Green;
}
else
{
textBox56.Text = textBox56.Text " " "X" " " sum28;
textBox56.ForeColor = Color.Red;
}
if (int.Parse(textBox58.Text.Trim()) == sum29)
{
textBox58.Text = textBox58.Text " " "√" " " sum29;
textBox58.ForeColor = Color.Green;
}
else
{
textBox58.Text = textBox58.Text " " "X" " " sum29;
textBox58.ForeColor = Color.Red;
}
if (int.Parse(textBox60.Text.Trim()) == sum30)
{
textBox60.Text = textBox60.Text " " "√" " " sum30;
textBox60.ForeColor = Color.Green;
}
else
{
textBox60.Text = textBox60.Text " " "X" " " sum30;
textBox60.ForeColor = Color.Red;
}
if (this.timer1.Enabled == true)
{
this.timer1.Enabled = false;
// button3.Text = "开始计时";
}
}
//private void button3_Click_1(object sender, EventArgs e)
//{
// if (this.timer1.Enabled == true)
// {
// this.timer1.Enabled = false;
// button3.Text = "开始计时";
// }
// else
// {
// currentCount_h = 0;
// currentCount_m = 0;
// currentCount_s = 0;
// this.timer1.Enabled = true;
// button3.Text = "停止计时";
// }
//}
private void timer1_Tick(object sender, EventArgs e)
{
currentCount_s ;
if(currentCount_s == 60)
{
currentCount_m ;
currentCount_s = 0;
if (currentCount_m == 60)
{
currentCount_h ;
currentCount_m = 0;
if (currentCount_h == 60)
{
currentCount_h = 0;
currentCount_m = 0;
currentCount_s = 0;
}
}
}
this.textBox61.Text = currentCount_h.ToString("00") ":" currentCount_m.ToString("00") ":" currentCount_s.ToString("00");
//this.textBox61.ForeColor = Color.Red;
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
textBox2.ForeColor = Color.Black;
}
private void textBox4_TextChanged(object sender, EventArgs e)
{
textBox4.ForeColor = Color.Black;
}
private void textBox6_TextChanged(object sender, EventArgs e)
{
textBox6.ForeColor = Color.Black;
}
private void textBox8_TextChanged(object sender, EventArgs e)
{
textBox8.ForeColor = Color.Black;
}
private void textBox10_TextChanged(object sender, EventArgs e)
{
textBox10.ForeColor = Color.Black;
}
private void textBox12_TextChanged(object sender, EventArgs e)
{
textBox12.ForeColor = Color.Black;
}
private void textBox14_TextChanged(object sender, EventArgs e)
{
textBox14.ForeColor = Color.Black;
}
private void textBox16_TextChanged(object sender, EventArgs e)
{
textBox16.ForeColor = Color.Black;
}
private void textBox18_TextChanged(object sender, EventArgs e)
{
textBox18.ForeColor = Color.Black;
}
private void textBox20_TextChanged(object sender, EventArgs e)
{
textBox20.ForeColor = Color.Black;
}
private void textBox22_TextChanged(object sender, EventArgs e)
{
textBox22.ForeColor = Color.Black;
}
private void textBox24_TextChanged(object sender, EventArgs e)
{
textBox24.ForeColor = Color.Black;
}
private void textBox26_TextChanged(object sender, EventArgs e)
{
textBox26.ForeColor = Color.Black;
}
private void textBox28_TextChanged(object sender, EventArgs e)
{
textBox28.ForeColor = Color.Black;
}
private void textBox30_TextChanged(object sender, EventArgs e)
{
textBox30.ForeColor = Color.Black;
}
private void textBox32_TextChanged(object sender, EventArgs e)
{
textBox32.ForeColor = Color.Black;
}
private void textBox34_TextChanged(object sender, EventArgs e)
{
textBox34.ForeColor = Color.Black;
}
private void textBox36_TextChanged(object sender, EventArgs e)
{
textBox36.ForeColor = Color.Black;
}
private void textBox38_TextChanged(object sender, EventArgs e)
{
textBox38.ForeColor = Color.Black;
}
private void textBox40_TextChanged(object sender, EventArgs e)
{
textBox40.ForeColor = Color.Black;
}
private void textBox42_TextChanged(object sender, EventArgs e)
{
textBox42.ForeColor = Color.Black;
}
private void textBox44_TextChanged(object sender, EventArgs e)
{
textBox44.ForeColor = Color.Black;
}
private void textBox46_TextChanged(object sender, EventArgs e)
{
textBox46.ForeColor = Color.Black;
}
private void textBox48_TextChanged(object sender, EventArgs e)
{
textBox48.ForeColor = Color.Black;
}
private void textBox50_TextChanged(object sender, EventArgs e)
{
textBox50.ForeColor = Color.Black;
}
private void textBox52_TextChanged(object sender, EventArgs e)
{
textBox52.ForeColor = Color.Black;
}
private void textBox54_TextChanged(object sender, EventArgs e)
{
textBox54.ForeColor = Color.Black;
}
private void textBox56_TextChanged(object sender, EventArgs e)
{
textBox56.ForeColor = Color.Black;
}
private void textBox58_TextChanged(object sender, EventArgs e)
{
textBox58.ForeColor = Color.Black;
}
private void textBox60_TextChanged(object sender, EventArgs e)
{
textBox60.ForeColor = Color.Black;
}
private void textBox61_TextChanged(object sender, EventArgs e)
{
//textBox61.ForeColor = Color.Red;
}
}
}
评论